package com.tang.model.state.v1;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/4 22:24
 * @Desc
 * @Remarks
 */
public class UserContext {
    public static final AbstractState UN_LOGIN_STATE = new UnLoginState();
    public static final AbstractState LOGIN_STATE = new LoginState();

    private AbstractState state = UN_LOGIN_STATE;

    {
        UN_LOGIN_STATE.setUserContext(this);
        LOGIN_STATE.setUserContext(this);
    }


    public void switchState(AbstractState loginState) {
        state = loginState;
    }

    public void favorite() {
        state.favorite();
    }

    public void comment(String comment) {
        state.comment(comment);
    }
}
